package edu.nf.dao.impl;



import edu.nf.ResultSetHandler;
import edu.nf.SQLExecutor;
import edu.nf.beans.annotations.Component;
import edu.nf.dao.FindAllEmpDao;
import edu.nf.handler.MapListHandler;
import edu.nf.utils.DBUtil;

import java.util.List;
import java.util.Map;

@Component("findEmp")
public class FindAllEmpDaoImpl implements FindAllEmpDao {



    @Override
    public List<Map<String, Object>> findAllEmp() {
        String sql = "SELECT STU_ID, STU_NAME, STU_SEX,CARD_NUM, CLASS_NAME, STU_ADDRESS FROM STU_INFO S INNER JOIN IDCARD_INFO ID ON S.STU_CARDID = ID.CARD_ID INNER JOIN CLASS_INFO C ON S.STU_CLASSID = C.CLASS_ID WHERE STU_STATUS=1";

        SQLExecutor se = new SQLExecutor(DBUtil.getConnection());
        ResultSetHandler handler = new MapListHandler();
        return se.executeQuery(sql, handler);

    }
}
